home *** CD-ROM | disk | FTP | other *** search
- %!
- %%VMusage: 0 0
- %%VMlocation: global
- %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% OPIProcSet: procedures to go into CommentDict to enable basic %%
- %% OPI processing. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
- /OPIProcSet <<
-
- /Initialise {
- userdict /OPIinitialised? known {
- userdict /OPIinitialised? get
- } {
- false
- } ifelse
- not {
- currentglobal false setglobal
- userdict /OPIdocomment {
- exch OPIdict 3 1 roll
- 1 index dup length string cvs anchorsearch pop pop
- (: ) anchorsearch pop pop put
- } put
- userdict /OPIdoobject {
- /OPIProcSet /ProcSet findresource begin DoObject end
- } put
- userdict /OPIdict 12 dict put
- userdict /OPIinitialised? true put
- setglobal
- } if
- } bind
-
- /CommentDict <<
- /ALDImageFileName {/ALDImageFileName OPIdocomment}
- /ALDImageID {/ALDImageID OPIdocomment}
- /ALDImageDimensions {/ALDImageDimensions OPIdocomment}
- /ALDImageCropRect {/ALDImageCropRect OPIdocomment}
- /ALDImagePosition {/ALDImagePosition OPIdocomment}
- /ALDImageColor {/ALDImageColor OPIdocomment}
- /ALDImageColorType {/ALDImageColorType OPIdocomment}
- /ALDImageTint {/ALDImageTint OPIdocomment}
- /ALDImageTransparency {/ALDImageTransparency OPIdocomment}
- /ALDImageGrayMap {/ALDImageGrayMap OPIdocomment}
- /BeginObject {pop OPIdoobject}
- >>
-
- /Known {
- 2 copy known {
- 1 index exch get true
- } {
- pop false
- } ifelse
- } bind
-
- %%
- %% OPIdict filename => OPIdict paramsdict file true
- %% See the manual before adding file types to this procedure.
- %%
- /FindFile {
- mark {
- 8 dict
- 2 index dup 0 get 16#28 eq {cvx exec} if
- (r) file 1 index /TIFFDecode filter
- } stopped {
- cleartomark false
- } {
- 4 2 roll pop pop true
- } ifelse
- } bind
-
- %%
- %% OPIdict paramsdict file => -
- %%
- /DoImage {
- exch begin
- 8 dict begin
- /ImageType 1 def
- /Width Width def
- /Height Height def
- /DataSource exch def
- /BitsPerComponent BitsPerComponent def
- /ImageMask false def
- gsave
- dup /ALDImagePosition get cvx exec
- 6 index sub exch 7 index sub exch
- 6 -2 roll
- 6 index sub exch 7 index sub exch
- 6 -2 roll pop pop
- 6 -2 roll matrix astore concat
- 0 0 1 1 rectclip
-
- dup /ALDImageDimensions get cvx exec
- 2 index /ALDImageCropRect get cvx exec
- 3 -1 roll sub 3 index exch div
- 3 1 roll exch sub 3 index exch div
- exch scale
- 2 index /ALDImageCropRect get cvx exec
- 4 1 roll pop pop 3 index div neg
- exch 2 index sub 2 index div
- translate
- pop pop
-
- /ALDImageOverprint Known {cvx exec setoverprint} if
-
- Photometric 2 lt {
- /ALDImageTint Known {cvx exec} {1} ifelse /ImageTint exch def
- /ALDImageGrayMap Known {
- [ [ 3 -1 roll cvx exec ] /exch load 1 index length
- Photometric 0 eq {1 /exch load /sub load 4 -1 roll} if
- 1 sub /mul load /cvi load /get load 65535 /div load] cvx settransfer
- } if
- /Decode [0 ImageTint Photometric 0 eq {exch} if ] def
- % {
- % /Decode [0 ImageTint Photometric 1 eq {exch} if ] def
- % }ifelse
- BitsPerComponent 1 eq {
- /ALDImageTransparency Known {cvx exec} {true} ifelse
- /ImageMask exch def
- } if
- /ALDImageColor Known {cvx exec} {0 0 0 1 (Black)} ifelse
-
- 6 -1 roll /ALDImageColorType Known not {(Spot)} if exch 7 1 roll
- dup (Separation) eq {
- pop pop [/Separation /All /DeviceCMYK {dup dup dup}] setcolorspace
- } {
- (Process) eq {
- pop
- [/Indexed /DeviceCMYK 255 [ 255 /div load 11 -4 roll
- systemdict /stdtinttransform get] cvx ] setcolorspace
- ImageMask {
- 255 setcolor
- } {
- /Decode [0 255 ImageTint mul round cvi Photometric 0 ne {exch} if] def
- } ifelse
- } {
- [/Separation 3 -1 roll /DeviceCMYK [ 9 -4 roll
- systemdict /stdtinttransform get] cvx ] setcolorspace
- } ifelse
- } ifelse
- } if
- Photometric 2 eq {
- /DeviceRGB setcolorspace
- /Decode [0 1 0 1 0 1] def
- } if
- Photometric 3 eq {
- [/Indexed /DeviceRGB Palette length 3 idiv 1 sub Palette] setcolorspace
- /Decode [0 Palette length 3 idiv 1 sub] def
- } if
- Photometric 5 eq {
- /DeviceCMYK setcolorspace
- /Decode [0 1 0 1 0 1 0 1] def
- } if
- /ImageMatrix [Width 0 0 Height neg 0 Height] def
- /ALDImageOperation Known {
- cvx exec
- } {
- currentdict ImageMask end end
- {imagemask} {image} ifelse
- } ifelse
- pop
- grestore
- } bind
-
- /DoObject {
- userdict /OPIdict get
- /ALDImageID Known not {
- /ALDImageFileName Known pop
- } if
- dup type /dicttype ne {
- mark 3 1 roll
- FindFile {
- {
- DoImage
- } stopped
- } {
- true
- } ifelse
- {
- (%%[ OPI substitution failed; using low resolution image ]%%) = flush
- } {
- 1 dict begin
- /junk 2048 string def
- {
- currentfile junk {readline} stopped {
- pop pop
- } {
- not {stop} if
- (%%EndObject) eq {exit} if
- } ifelse
- } loop
- end
- } ifelse
- cleartomark
- } {
- pop
- } ifelse
- userdict /OPIdict 12 dict put
- } bind
-
- >> /ProcSet defineresource
-
- dup /Initialise get exec
-
-